package net.cruciblesoftware.embers;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;

public class EmbersActivity extends Activity {
    private ScreenSurface screen;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Log.i("ACTIV", "creating activity...");

        // load resources before creating content view
        Settings.load(this.getResources());
        setContentView(R.layout.main);
     
        screen = (ScreenSurface)findViewById(R.id.scene);
    }

    @Override
    public void onRestart() {
        super.onRestart();
        Log.i("ACTIV", "restarting activity...");
    }

    @Override
    public void onStart() {
        super.onStart();
        Log.i("ACTIV", "starting activity...");
    }

    @Override
    public void onResume() {
        super.onResume();
        Log.i("ACTIV", "resuming activity...");
        LogicThread lt = screen.getThread();
        if(lt != null)
            lt.pause(false);
    }

    @Override
    public void onPause() {
        super.onPause();
        Log.i("ACTIV", "pausing activity...");
        LogicThread lt = screen.getThread();
        if(lt != null)
            lt.pause(true);
    }

    @Override
    public void onStop() {
        super.onStop();
        Log.i("ACTIV", "stopping activity...");
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        Log.i("ACTIV", "destroying the activity");
    }
}
